/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package montecarlo.math;

/**
 *
 * @author alucard
 */
public class monteCarloHolder
{

    private double sum;
    private int nbFinished;
    private double finaleSum;
    private volatile double[] percents;

    public monteCarloHolder(int nbThread)
    {
        this.sum = 0;
        this.nbFinished = 0;
        this.percents = new double[nbThread+1];
    }

    public synchronized double getSum()
    {
        return sum;
    }

    public synchronized void setSum(double sum)
    {
        this.sum = sum;
    }

    public synchronized int getNbFinished()
    {
        return nbFinished;
    }

    public synchronized void setNbFinished(int nbFinished)
    {
        this.nbFinished = nbFinished;
    }

    public synchronized double getFinaleSum()
    {
        return finaleSum;
    }

    public synchronized void setFinaleSum(double finaleSum)
    {
        this.finaleSum = finaleSum;
    }

    public void setPercent(int id, double percent)
    {
        this.percents[id] = percent;
    }
    
    public double getPercent(int id)
    {
        return this.percents[id];        
    }
}
